From ed6c14234c3e6c1f767de497d26d652c9aafa65f Mon Sep 17 00:00:00 2001 From: GMT 2001 Tony Gale Date: Tue, 27 Feb 2001 13:38:33 +0000 Subject: [PATCH] New question re memory leaks. Tue Feb 27 13:37:38 GMT 2001 Tony Gale * docs/faq/gtk-faq.sgml: New question re memory leaks. --- ChangeLog | 4 ++++ ChangeLog.pre-2-0 | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ ChangeLog.pre-2-2 | 4 ++++ ChangeLog.pre-2-4 | 4 ++++ ChangeLog.pre-2-6 | 4 ++++ ChangeLog.pre-2-8 | 4 ++++ docs/faq/gtk-faq.sgml | 19 +++++++++++++++++++ 8 files changed, 47 insertions(+) diff --git a/ChangeLog b/ChangeLog index cfd87a593a..a613f1cde1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Feb 27 13:37:38 GMT 2001 Tony Gale + + * docs/faq/gtk-faq.sgml: New question re memory leaks. + 2001-02-25 Hans Breuer * gdk/gdk.h : changed #ifdef GDK_DISBALE_DEPRECARED to #ifndef diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index cfd87a593a..a613f1cde1 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,7 @@ +Tue Feb 27 13:37:38 GMT 2001 Tony Gale + + * docs/faq/gtk-faq.sgml: New question re memory leaks. + 2001-02-25 Hans Breuer * gdk/gdk.h : changed #ifdef GDK_DISBALE_DEPRECARED to #ifndef diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index cfd87a593a..a613f1cde1 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,7 @@ +Tue Feb 27 13:37:38 GMT 2001 Tony Gale + + * docs/faq/gtk-faq.sgml: New question re memory leaks. + 2001-02-25 Hans Breuer * gdk/gdk.h : changed #ifdef GDK_DISBALE_DEPRECARED to #ifndef diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index cfd87a593a..a613f1cde1 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,7 @@ +Tue Feb 27 13:37:38 GMT 2001 Tony Gale + + * docs/faq/gtk-faq.sgml: New question re memory leaks. + 2001-02-25 Hans Breuer * gdk/gdk.h : changed #ifdef GDK_DISBALE_DEPRECARED to #ifndef diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index cfd87a593a..a613f1cde1 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,7 @@ +Tue Feb 27 13:37:38 GMT 2001 Tony Gale + + * docs/faq/gtk-faq.sgml: New question re memory leaks. + 2001-02-25 Hans Breuer * gdk/gdk.h : changed #ifdef GDK_DISBALE_DEPRECARED to #ifndef diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index cfd87a593a..a613f1cde1 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,7 @@ +Tue Feb 27 13:37:38 GMT 2001 Tony Gale + + * docs/faq/gtk-faq.sgml: New question re memory leaks. + 2001-02-25 Hans Breuer * gdk/gdk.h : changed #ifdef GDK_DISBALE_DEPRECARED to #ifndef diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index cfd87a593a..a613f1cde1 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,7 @@ +Tue Feb 27 13:37:38 GMT 2001 Tony Gale + + * docs/faq/gtk-faq.sgml: New question re memory leaks. + 2001-02-25 Hans Breuer * gdk/gdk.h : changed #ifdef GDK_DISBALE_DEPRECARED to #ifndef diff --git a/docs/faq/gtk-faq.sgml b/docs/faq/gtk-faq.sgml index e986e4512c..1f9f9b2c41 100644 --- a/docs/faq/gtk-faq.sgml +++ b/docs/faq/gtk-faq.sgml @@ -2283,6 +2283,25 @@ distribution, in the file gtk/testdnd.c. + + + +Why does GTK+/GLib leak memory? + +It doesn't. Both GLib and the C library (malloc implementation) +will cache allocated memory on occasion, even if you free it with +free(). + +So you can't generally use tools such as top to see if you are +using free() properly (aside from the very roughest of estimations, i.e. +if you are really, really screwing up top will show that, but you can't +distinguish small mistakes from the GLib/malloc caches). + +In order to find memory leaks, use proper memory profiling +tools. + + + -- 2.30.2